<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Admin\Item;
use App\Admin\User_itemComment;
use Input;
class User_itemCommentController extends Controller
{
    public function index(){
        $data = Item::select('id','item_name','cover_img') -> with('rel_comment') -> where('comment_num','<>','0') -> get();
        return view('admin.user_item_comment.index',['data' => $data]);
    }

    public function search(){
        $keyword    = Input::get('key');
        $start_time = Input::get('datemin') ? Input::get('datemin') . ' 00:00:00' : '1999-01-01 00:00:00';
        $end_time   = Input::get('datemax') ? Input::get('datemax') . ' 23:59:59' : date('Y-m-d H:i:s');
        $field      = Input::get('item_id') ? 'item_id' : 'id';
        $eqOrneq    = Input::get('item_id') ? '=' : '<>';
        $value      = Input::get('item_id') ? Input::get('item_id') : '';
    }
}